[ Home ] [ Authors ] [ Index ] [ Abbreviations ] [ Key bindings ]

User's Guide to the Tycho File Class

The File class in Tycho is the base class for most editors. It provides a top-level window with a menu bar at the top. It also provides some common key bindings that are therefore shared by all derived classes, and it handles auto-save and crash recovery. By itself, this class is not very useful; the derived classes are the ones actually used.

File Access Commands

The following commands are available in the File menu as well through key bindings.

C-x C-f
open a file
C-x i
insert a file at the cursor
C-x C-s
save to the current file name
C-x C-w
save to some other file name
C-x p
print the contents
C-x C-r
evaluate a file (only valid in some derived classes)
C-x k
close the window
C-x 0
close the window
C-x o
move the focus to another window
C-x C-c
exit the program

In addition to all of the above, the File menu provides the following command:

Revert
Revert to the previously saved version of this file.

Window Menu

File objects have a Window menu in the menu bar. The menu contains commands to open new, blank editors for any type of editor that has been registered with the File class. In addition, all open editors that are associated with named files are listed. This makes it easier to find editors that may have been buried by other windows on the screen. Note that if the editor is open in another screen of a virtual window manager, it will not appear when you issue the command in the Window menu. Also, if an editor has the name "NoName" associated with it, it does not appear in the Window menu. To give it a name, use SaveAs (in the File menu).

Help Menu

The Help menu provides access to the on-line documentation for Tycho. The "User's Guide" entry in the menu will bring up a user's guide for the widget in which you invoke the command, if one exists. The "Index" entry will bring up the master Tycho index.

Keyboard Traversal of the Menus

The mechanism for keyboard traversal of the menus is exactly that provided in Tk. Thus, the following explanation is from the Tk man pages, written by John Ousterhout.

"The menus can be invoked using the Alt key (sometimes "Alt Graph") together with the underlined character in the menu title. Once the menu is posted, typing the underlined character in a menu item will invoke it. The F10 key will post the "File" menu.

Autosave and Crash Recovery

Periodically, if its data has been modified, a File object will save the data to a file with the same name as the current file but with the prefix "#auto#". This file is automatically removed when you save the modified data.

If you are running Ptolemy with Tycho, then Tycho will also attempt to save modified data when the program crashes. This is important because Ptolemy is fundamentally an extensible system, into which users routinely add their own code, so it is not uncommon in the process of doing code development to get crashes. The crash recovery files have the prefix "#crash". There is no guarantee that their contents will be correct, since often the crash occurs due to corrupted data.


Copyright © 1996, The Regents of the University of California. All rights reserved.
Last updated: 96/04/09, comments to: eal@eecs.berkeley.edu